#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <asm/mach/map.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
/*
 *
 * author:
 * version:
 * description:
 *
 */


struct beep_dev {

};

static struct beep_dev beep;	// led device

static ssize_t led_read(struct file *filp, char __user *buf, size_t cnt, loff_t *offt)
{

	return 0;
}

static ssize_t led_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offt)
{
	return 0;
}


/* @description : 打开设备
 *
 * @param - inode : 传递给驱动的inode
 * @param - filp  : 设备文件，file结构有个叫做private_data的成员变量
 * 					一般在open的时候将private_data指向设备结构体。
 *
 * @return		  : 0 成功； 其他 失败
 */
static int led_open(struct inode *inode, struct file *filp){
	return 0;
}

static int led_release(struct inode *inode, struct file *filp){

	return 0;
}

static struct file_operations beep_fops = {
	.open = led_open,
	.read = led_read,
	.write = led_write,
	.release = led_release,
};

// traditional matching method
static const struct i2c_device_id ov5640_id[] = {
	{ "ovti,ov5640", 0 },
};
MODULE_DEVICE_TABLE(i2c, ov5640_id);

// device tree match
static const struct of_device_id ov5640_of_match[] = {
	{ .compatible = "ovti,ov5640" },
	{       },
};
MODULE_DEVICE_TABLE(of, ov5640_of_match);

static struct i2c_driver ov5640_i2c_driver = {
	.driver = {
		.owner = THIS_MODULE,
		.name = "ov5640",
		.of_match_table = of_match_ptr(ov5640_of_match),
	},
	.probe = ov5640_probe,
	.remove = ov5640_remove,
	.id_table = ov5640_id,
}
/*
 * @description: driver entry function
 * @param: void
 * @
 *
 */

static int __init ov5640_init(void)
{
	int ret = 0;

	ret = i2c_add_driver(&ov5640_i2c_driver);

	return ret;
}


/*
 * @description: driver entry function
 * @param: void
 * @
 */
static void __exit ov5640_exit(void)
{
	i2c_del_driver(&ov5640_i2c_driver);
}


module_init(ov5640_init);
module_exit(0v5640_exit);


MODULE_AUTHOR("maliuping <maliuping.270foxmail.com>");
MODULE_DESCRIPTION("OV5640 CMOS Image Sensor driver");
MODULE_LICENSE("GPL");
